package com.common.account.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.common.account.entity.AuMechanism;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 公司部门 Mapper 接口
 * </p>
 *
 * @author wangguochao
 * @since 2021-01-27
 */
public interface AuMechanismMapper extends BaseMapper<AuMechanism> {
    @Select("select am.* " +
            "from au_mechanism as am " +
            "         join user_and_mechanism uam on am.id = uam.au_mechanism_id " +
            "         join au_user au on uam.au_user_id = au.id " +
            "where am.is_del = 0 " +
            "  and au.user_name =  #{userName}")
    List<AuMechanism> findByUser(String userName);
}
